Trigonometric funtions from "9,000 CIRCLES"

Charlie Veniot24th June 2022 at 9:55pm
' BASIC Anywhere Machine program by Charlie Veniot
' Trigonometric functions by Hamid Naderi Yeganeh for "9,000 CIRCLES" at https://blogs.scientificamerican.com/guest-blog/making-mathematical-art/

pi = 3.1415929
screen _newimage(2500, 2200, 21)
for k = 1 to 9000
x = int ( cos(14 * pi * k / 9000) * ( 1 - ( 3 / 4 ) * (cos(36 * pi * k / 9000))^2 ) * 1000 )
y = int ( sin(14 * pi * k / 9000) * ( 1 - ( 3 / 4) * (cos(36 * pi * k / 9000))^2 ) * 1000 )
r = int ( ( 1 / 200 + 1 / 10 * (sin(64 * pi * k / 9000))^6 ) * 1000 )
' print x, y, r
if r > 70 then
   c = 255 * 256^2 + r * 256 + r
elseif r < 70 and r > 10 then
   c = r * 256^2 + 255 * 256 + r
else
   c = (255-r) * 256 + 255
end if
circle (x+1200,y+1100), r, c
next k